<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


//上传图片路由
Route::namespace('Common')->group(function () {
    Route::post('image',"ImgUploadController@imgUpload");
});
Route::post('images',"ImgUploadController@imgUpload2");

Route::namespace('Admin')->group(function () {
    //用户
    Route::resource('user',"UserController");
    Route::get('getAdminUsers','UserController@getAdminUsers');
    Route::post('banUser','UserController@banUser'); //封号与解封

//    图片
    Route::resource('picture',"PictureController");
    Route::post('checkPicture','PictureController@check');
    Route::get('getManagePictures','PictureController@getManagePicturesUrl');//管理获取图片
    Route::post('delPicture','PictureController@delPicture');//删除图片

    //分组路由
    Route::resource('group',"GroupController");
    Route::post('changeGroupStatus',"GroupController@changeGroupStatus");//改变分组状态

    //等级管理路由
    Route::resource('rank',"RankController");
    Route::get('getUserRank',"RankController@getUserRank"); //获取用户等级列表
    Route::get('getPictureRank',"RankController@getPictureRank"); //获取图片等级列表
    Route::post('updateRank',"RankController@update"); //更新等级信息
    Route::post('delRankupdateRank',"RankController@destroy"); //更新等级信息

    //分页
    Route::get('page',"PictureController@page");
    //分析
    Route::get('refreshDayUserNum','AnalysisController@refreshDayUserNum');//刷新每日新增用户数
    Route::get('getDayUserNum','AnalysisController@getDayUserNum');//获取每日新增用户数
    Route::get('refreshSexNum','AnalysisController@refreshSexNumFromDB');//刷新男女用户数和用户总数
    Route::get('getSexNum','AnalysisController@getSexNum'); //获取男女用户数和用户总数

    Route::get('refreshDayUserNum','AnalysisController@refreshDayUserNum');//刷新每日新增图片数
    Route::get('getDayPictureNum','AnalysisController@getDayPictureNum');//获取每日新增图片数
    Route::get('refreshDayPictureNum','AnalysisController@refreshDayPictureNum');//刷新图片总数
    Route::get('getPictureNum','AnalysisController@getPictureNum'); //获取图片数量

    Route::get('clearAll','AnalysisController@clearAll'); //清空所有记录


    //设置
    Route::get('blood','SettingController@blood');
    Route::get('maxBlood','SettingController@maxBlood');
    Route::get('ticket','SettingController@ticket');
    Route::get('addBlood','SettingController@addBlood');
    Route::get('banHistoryTime','SettingController@banHistoryTime');
});

